﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Crystal.CustomControls
{
    public partial class CrystalComboBox : Infragistics.Win.UltraWinGrid.UltraCombo
    {
        public CrystalComboBox()
        {
            Layout += CrystalComboBox_InitializeLayout;
            //InitializeComponent();
        }

        private void CrystalComboBox_InitializeLayout(object sender, LayoutEventArgs e)
        {
            if (e.AffectedControl.GetType().Equals(typeof(CrystalComboBox)))
            {
                ((CrystalComboBox)e.AffectedControl).Text = "";
            }


            //int[] Values = new int[3];
            //if (CommonCustomControls.IsValidString(StyleManager.GetStyle("TextEditorBackColor"), ref Values))
            //{
            //    //e.AffectedControl.BackColor = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            //    e.AffectedControl.BackColor = Color.White;
            //}

            //if (CommonCustomControls.IsValidString(StyleManager.GetStyle("TextEditorForeColor"), ref Values))
            //{
            //    //e.AffectedControl.ForeColor = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            //    e.AffectedControl.ForeColor = Color.Black;
            //}

            //if (e.AffectedControl.GetType().Equals(typeof(CrystalComboBox)))
            //{
            //    ((CrystalComboBox)e.AffectedControl).DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2010;
            //    ((CrystalComboBox)e.AffectedControl).Appearance.BorderColor = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            //    ((CrystalComboBox)e.AffectedControl).Appearance.BorderColor2 = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            //    ((CrystalComboBox)e.AffectedControl).Appearance.BorderColor3DBase = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            //}
        }
    }
}
